﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
// add
using System.Data;

namespace FormBase
{
    public partial class FBRW0010 : Form
    {
        //CProject mProject = Program.gProject;
        DataSet mds1 = new DataSet("DstaSetName");

        public FBRW0010()
        {
            InitializeComponent();
        }

        private void FBRW0010_Load(object sender, EventArgs e)
        {
            string s1;

            mds1.Namespace = "n";
            mds1.Prefix = "p";

            DataTable table1 = new DataTable("T1");
            table1.Columns.Add("F01");
            table1.Columns.Add("F02");
            table1.Rows.Add("R1", 1);
            table1.Rows.Add("R2", 2);

            DataTable table2 = new DataTable("T2");
            table2.Columns.Add("F01");
            table2.Columns.Add("F02");
            table2.Rows.Add(1, "R1");
            table2.Rows.Add(2, "R2");

            // Create a DataSet and put both tables in it.
            mds1.Tables.Add(table1);
            mds1.Tables.Add(table2);

            // Visualize DataSet.
            s1 = mds1.GetXml();
            CProject.mApp.mAction.AppendMsgDebug(s1);

            // output s1: (without prefix and namespace)
            //<DstaSetName>
            //  <T1>
            //    <F01>R1</F01>
            //    <F02>1</F02>
            //  </T1>
            //  <T1>
            //    <F01>R2</F01>
            //    <F02>2</F02>
            //  </T1>
            //  <T2>
            //    <F01>1</F01>
            //    <F02>R1</F02>
            //  </T2>
            //  <T2>
            //    <F01>2</F01>
            //    <F02>R2</F02>
            //  </T2>
            //</DstaSetName>.

            // output s1: (with prefix and namespace)
            //<p:DstaSetName xmlns:p="n">
            //  <T1 xmlns="n">
            //    <F01>R1</F01>
            //    <F02>1</F02>
            //  </T1>
            //  <T1 xmlns="n">
            //    <F01>R2</F01>
            //    <F02>2</F02>
            //  </T1>
            //  <T2 xmlns="n">
            //    <F01>1</F01>
            //    <F02>R1</F02>
            //  </T2>
            //  <T2 xmlns="n">
            //    <F01>2</F01>
            //    <F02>R2</F02>
            //  </T2>
            //</p:DstaSetName>.
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {

        }
    }
}
